---
page_title: "cloudflare_device_settings_policy Resource - Cloudflare"
subcategory: ""
description: |-
  Provides a Cloudflare Device Settings Policy resource. Device policies configure settings applied to WARP devices.
---

# cloudflare_device_settings_policy (Resource)

Provides a Cloudflare Device Settings Policy resource. Device policies configure settings applied to WARP devices.

## Example Usage

```terraform
resource "cloudflare_device_settings_policy" "developer_warp_policy" {
  account_id            = "f037e56e89293a057740de681ac9abbe"
  name                  = "Developers WARP settings policy"
  description           = "Developers WARP settings policy description"
  precedence            = 10
  match                 = "any(identity.groups.name[*] in {\"Developers\"})"
  default               = false
  enabled               = true
  allow_mode_switch     = true
  allow_updates         = true
  allowed_to_leave      = true
  auto_connect          = 0
  captive_portal        = 5
  disable_auto_fallback = true
  support_url           = "https://cloudflare.com"
  switch_locked         = true
  service_mode_v2_mode  = "warp"
  service_mode_v2_port  = 3000
  exclude_office_ips    = false
}
```
<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `account_id` (String) The account identifier to target for the resource.
- `description` (String) Description of Policy.
- `name` (String) Name of the policy.

### Optional

- `allow_mode_switch` (Boolean) Whether to allow mode switch for this policy.
- `allow_updates` (Boolean) Whether to allow updates under this policy.
- `allowed_to_leave` (Boolean) Whether to allow devices to leave the organization. Defaults to `true`.
- `auto_connect` (Number) The amount of time in seconds to reconnect after having been disabled.
- `captive_portal` (Number) The captive portal value for this policy. Defaults to `180`.
- `default` (Boolean) Whether the policy refers to the default account policy.
- `disable_auto_fallback` (Boolean) Whether to disable auto fallback for this policy.
- `enabled` (Boolean) Whether the policy is enabled (cannot be set for default policies). Defaults to `true`.
- `exclude_office_ips` (Boolean) Whether to add Microsoft IPs to split tunnel exclusions.
- `match` (String) Wirefilter expression to match a device against when evaluating whether this policy should take effect for that device.
- `precedence` (Number) The precedence of the policy. Lower values indicate higher precedence.
- `service_mode_v2_mode` (String) The service mode. Available values: `1dot1`, `warp`, `proxy`, `posture_only`, `warp_tunnel_only`. Defaults to `warp`.
- `service_mode_v2_port` (Number) The port to use for the proxy service mode. Required when using `service_mode_v2_mode`.
- `support_url` (String) The support URL that will be opened when sending feedback.
- `switch_locked` (Boolean) Enablement of the ZT client switch lock.

### Read-Only

- `id` (String) The ID of this resource.

## Import

Import is supported using the following syntax:

```shell
# For default device settings policies you must use "default" as the policy ID.
$ terraform import cloudflare_device_settings_policy.example <account_id>/<device_policy_id>
```
